<div class="wrap-right-vouser" id="mabe_list" page="1">
</div>
<script>
$(document).ready(function(){
    
    
    $.get('<?php echo url_for('skill/mabe_like_data'); ?>',{},function(data){
        $("#mabe_list").html(data);
    });
    
    $("#mabe_list").on('click','#like_next_page',function(){
        
        var page = parseInt($("#mabe_list").attr('page'))+1;
        
        $.get('<?php echo url_for('skill/mabe_like_data'); ?>',{'page':page},function(data){
            $("#mabe_list").html(data);
            $("#mabe_list").attr('page',page);
        });
    });

$("#mabe_list").on('click','#attention_other',function(){
        var user_id = $(this).attr('user_id');
        var attention = $(this);
        
        $.post('<?php echo url_for('skill/user_attention'); ?>',{'user_id': user_id},function(data){
            var data = eval('('+data+')');
            var error = data.error;
            var msg = data.msg;
            var attention_people = data.attention_people;
            
            alert(msg);
            
            if(error == 0){
                 attention.text('已关注');
                 $("#attention_people").text(attention_people);
            }else if(error == 1){
                attention.text('+ 关注');
                $("#attention_people").text(attention_people);
            }
            
        });
    });
    });
</script>